﻿using System;

namespace Looptribe.Moodlin8.Model.Api
{
    public class ServiceCredentials
    {
        public const string Moodlin8ServiceName = "moodlin8";

        public string Username { get; set; }
        public string Password { get; set; }
        public Uri BaseUri { get; set; }
        public string ServiceName { get; set; }

        public static bool IsNullOrEmpty(ServiceCredentials credentials)
        {
            return credentials == null ||
                String.IsNullOrEmpty(credentials.Username) ||
                String.IsNullOrEmpty(credentials.Password) ||
                String.IsNullOrEmpty(credentials.BaseUri.ToString()) ||
                String.IsNullOrEmpty(credentials.ServiceName);
        }
    }
}
